<!-- 
  @author : andy
  @desciption : 内嵌页面组件
-->
<template>
  <div class="iframe-box">
    <iframe class="iframe" :src="iframePath" frameborder="0"></iframe>
  </div>
</template>

<script lang='ts' setup>
import { ref, watchEffect } from 'vue';
import { useRoute } from 'vue-router';
import { useAccessStore } from '@/stores/access/access';
const accessStore = useAccessStore();
const route = useRoute();
const iframePath = ref('');
watchEffect(() => {
  const currentMenu = accessStore.iframeMenus.find(menu => menu.path === route.path);
  if (currentMenu) {
    iframePath.value = currentMenu.iframePath;
  }
})
</script>

<style lang='less' scoped>
.iframe-box {
  width: 100%;
  height: 100%;
  overflow: hidden;
  .iframe {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }
}
</style>